package com.wiloon.java8x.basic;

/*
 * Created by roy on 8/31/17;
 */
public class StringX {


    public static void main(String args[]) {
//        String Str1 = new String("www.runoob.com");
//        String Str2 = new String("runoob");
//        String Str3 = new String("RUNOOB");
//
//        System.out.print("返回值 :");
//        System.out.println(Str1.regionMatches(4, Str2, 0, 5));
//
//        System.out.print("返回值 :");
//        System.out.println(Str1.regionMatches(4, Str3, 0, 5));
//
//        System.out.print("返回值 :");
//        System.out.println(Str1.regionMatches(true, 4, Str3, 0, 5));
//

        String foo = "abcdefg";
        System.out.println(foo.regionMatches(0, "a", 0, 1));
        System.out.println(foo.regionMatches(1, "b", 0, 1));

        System.out.println(foo.regionMatches(0, "ab", 0, 1));
        System.out.println(foo.regionMatches(0, "ab", 0, 2));
        System.out.println(foo.regionMatches(0, "ab", 0, 3));


        System.out.println(foo.regionMatches(1, "ab", 1, 1));
    }


}
